package com.bw.zg3park2212.apply

import android.widget.TextView
import com.bw.base.entity.ParkApplyEntityItem
import com.bw.base.entity.RepairEntity
import com.bw.base.entity.RepairEntityItem
import com.bw.zg3park2212.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class OrderApplyAdpter : BaseQuickAdapter<RepairEntityItem, BaseViewHolder>(R.layout.item_park_apply) {
    override fun convert(helper: BaseViewHolder, item: RepairEntityItem) {
        helper.setText(R.id.type,"报修申请")
        helper.setText(R.id.content,item.faultDescription)
        helper.setText(R.id.time,item.repairTime)
        val status = helper.getView<TextView>(R.id.sutae)
        if (item.processingStatus=="待处理"){
            status.text="待处理"
            status.setTextColor(context.resources.getColor(R.color.color_weihu))
        }else if (item.processingStatus=="处理中"){
            status.text="处理中"
            status.setTextColor(context.resources.getColor(R.color.color_kongxian))
        }else if (item.processingStatus=="已完成"){
            status.text="已完成"
            status.setTextColor(context.resources.getColor(R.color.color_red))
        }
    }
}